<?php

namespace App\Modules\Device\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * @package App\Modules\Device\Models
 */
class Device extends Model
{
    protected $table = 'device';

    protected $fillable = ['id','facory_id','admin_user_id','device_code', 'device_name', 'bundled_date', 'is_bundled', 'bundled_user_id', 'status','created_at','updated_at'];

    //获取商家
    public static function deviceList(){

        return self::where('status',1)->paginate(10);
    }

    //添加品牌
    public static function addDevice($param){
        return self::create($param);
    }

    //跟新品牌
    public static function upDevice($id,$param){
        return self::where('id',$id)->update($param);
    }

}